package org.example.Controller;

import lombok.extern.slf4j.Slf4j;
import org.example.Pojo.ClazzOption;
import org.example.Pojo.JobOption;
import org.example.Pojo.Result;
import org.example.Server.ReportServert;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@Slf4j
public class ReportController {

     @Autowired
     private ReportServert reportServert;

     /*
     * 返回有关工作的相关的数据
     * */
     @GetMapping("/report/empJobData")
    public Result getEmpJobData() {
         log.info("getEmpJobData");
         JobOption jobOption = reportServert.getEmpData();
         return Result.success(jobOption);
     }


     /*
     * 返回有关性别相关的数据
     * */
    @GetMapping("/report/empGenderData")
    public Result getEmpGanderData(){
        log.info("getEmpGanderData");
        List<Map<String,Object>> list=reportServert.getEmpGanderData();
        return Result.success(list);
    }

    /*
     * 班级人数统计
     * */
    @GetMapping("/report/studentCountData")
    public Result getStudentCountReport(){
        log.info("getStudentCountReport");
        ClazzOption clazzOption=reportServert.getStudentCountReport();
        return Result.success(clazzOption);
    }


    /*
     *班级学历统计
     * */
    @GetMapping("/report/studentDegreeData")
    public Result getStudentDegreeReport(){
        log.info("getStudentDegreeReport");
        List<Map<String,Object>> list=reportServert.getStudentDegreeReport();
        return Result.success(list);
    }

}
